package ctn.hibernate.po;

// Generated 2011-12-8 2:29:36 by Hibernate Tools 3.2.4.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CtnCpaVer generated by hbm2java
 */
@Entity
@Table(name = "ctn_cpa_ver", catalog = "cpa")
public class CtnCpaVer implements java.io.Serializable {

	private Long id;
	private String version;
	private CtnGrp ctnGrpByImplGrpId;
	private CtnCpaInfo ctnCpaInfo;
	private CtnGrp ctnGrpByWatchGrpId;
	private Date completeDate;
	private Date effDate;
	private String status;
	private Set<CtnCpaSpec> ctnCpaSpecs = new HashSet<CtnCpaSpec>(0);

	public CtnCpaVer() {
	}

	public CtnCpaVer(Long id, CtnCpaInfo ctnCpaInfo) {
		this.id = id;
		this.ctnCpaInfo = ctnCpaInfo;
	}

	public CtnCpaVer(Long id, CtnGrp ctnGrpByImplGrpId, CtnCpaInfo ctnCpaInfo,
			CtnGrp ctnGrpByWatchGrpId, Date completeDate, Date effDate,
			String status, Set<CtnCpaSpec> ctnCpaSpecs) {
		this.id = id;
		this.ctnGrpByImplGrpId = ctnGrpByImplGrpId;
		this.ctnCpaInfo = ctnCpaInfo;
		this.ctnGrpByWatchGrpId = ctnGrpByWatchGrpId;
		this.completeDate = completeDate;
		this.effDate = effDate;
		this.status = status;
		this.ctnCpaSpecs = ctnCpaSpecs;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "VERSION", nullable = false, length = 5)
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "IMPL_GRP_ID")
	public CtnGrp getCtnGrpByImplGrpId() {
		return this.ctnGrpByImplGrpId;
	}

	public void setCtnGrpByImplGrpId(CtnGrp ctnGrpByImplGrpId) {
		this.ctnGrpByImplGrpId = ctnGrpByImplGrpId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CPA_ID", nullable = false)
	public CtnCpaInfo getCtnCpaInfo() {
		return this.ctnCpaInfo;
	}

	public void setCtnCpaInfo(CtnCpaInfo ctnCpaInfo) {
		this.ctnCpaInfo = ctnCpaInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "WATCH_GRP_ID")
	public CtnGrp getCtnGrpByWatchGrpId() {
		return this.ctnGrpByWatchGrpId;
	}

	public void setCtnGrpByWatchGrpId(CtnGrp ctnGrpByWatchGrpId) {
		this.ctnGrpByWatchGrpId = ctnGrpByWatchGrpId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "COMPLETE_DATE", length = 19)
	public Date getCompleteDate() {
		return this.completeDate;
	}

	public void setCompleteDate(Date completeDate) {
		this.completeDate = completeDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EFF_DATE", length = 19)
	public Date getEffDate() {
		return this.effDate;
	}

	public void setEffDate(Date effDate) {
		this.effDate = effDate;
	}

	@Column(name = "STATUS", length = 10)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ctnCpaVer")
	public Set<CtnCpaSpec> getCtnCpaSpecs() {
		return this.ctnCpaSpecs;
	}

	public void setCtnCpaSpecs(Set<CtnCpaSpec> ctnCpaSpecs) {
		this.ctnCpaSpecs = ctnCpaSpecs;
	}

}
